package com.dony.web.controller.push;

import com.dony.common.core.controller.BaseController;
import com.dony.common.core.domain.AjaxResult;
import com.dony.order.service.IOrderService;
import com.dony.shop.domain.vo.PushVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;


@Slf4j
@RestController
@RequestMapping("/shopee/push")
public class PushController extends BaseController {

    @Resource
    IOrderService orderService;

    /**
     * 接收推送消息
     */
    @PostMapping("/receive")
    public AjaxResult receivePush(@RequestBody PushVo pushVo) {
        //校验推送的内容
        if (pushVo != null && pushVo.getCode()==3) {
            orderService.handleShopeePush(pushVo);
        }
        return AjaxResult.success();
    }



}
